package com.wang.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wang.project.model.dto.InterfacePay.InterfacePaymentRequest;
import com.wang.project.model.dto.userinterfaceinfo.UserInterfaceInfoGetRequest;
import com.wang.project.model.entity.UserInterfaceInfo;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;

public interface UserInterfaceInfoService extends IService<UserInterfaceInfo> {
    void validUserInterfaceInfo(UserInterfaceInfo userInterfaceInfo, boolean add);

    /**
     * 调用接口统计
     *
     * @param interfaceInfoId
     * @param userId
     * @return
     */
    boolean invokeCount(long interfaceInfoId, long userId);

    /**
     * 计算用户还有没有调用次数
     *
     * @param interfaceInfoId
     * @param userId
     * @return
     */
    Integer getInvokeUserCount(long interfaceInfoId, long userId);

    /**
     * 用户申请接口调用次数
     * @param userInterfaceInfoGetRequest
     * @param request
     * @return
     */
    Boolean getInterfaceNum(@RequestBody UserInterfaceInfoGetRequest userInterfaceInfoGetRequest, HttpServletRequest request);


}
